﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace POVRay {
    [PRBlock("merge")]
    public class Merge : Object {
        public LinkedList<Object> Objects = new LinkedList<Object>();

        public Merge(params Object[] objects) {
            foreach (var obj in objects) {
                Objects.AddLast(obj);
            }
        }

        public override string ToString(int level) {
            //return this.POVRayString(level);

            StringBuilder sb = new StringBuilder();

            sb.Append("merge { ");
            foreach (Object obj in Objects) {
                sb.Append(Scene.Indentation(level + 1) + obj.ToString(level + 1));
            }
            sb.Append(GeneralParameters(level + 1));
            sb.Append(Scene.Indentation(level) + "}");

            return sb.ToString();
        }
    }
}
